<?php
	echo " SUBFOLDER : ". Yii::app()->session["subfolder"];
?>
<h1>Sample Page</h1>
<script type="text/javascript">
	$(function(){
		tinymce.init({
			selector: "textarea",theme: "modern",width: 680,height: 300,
		    plugins: [
		         "advlist autolink link image lists charmap print preview hr anchor pagebreak",
		         "searchreplace wordcount visualblocks visualchars insertdatetime media nonbreaking",
		         "table contextmenu directionality emoticons paste textcolor responsivefilemanager"
		   ],
		   toolbar1: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect",
		   toolbar2: "| responsivefilemanager | link unlink anchor | image media | forecolor backcolor  | print preview code ",
		   image_advtab: true ,
		   menubar: false,		   
		   external_filemanager_path:"<?php echo Yii::app()->request->baseUrl; ?>/filemanager/",
		   filemanager_title:"Responsive Filemanager" ,
		   external_plugins: { "filemanager" : "<?php echo Yii::app()->request->baseUrl; ?>/filemanager/plugin.min.js"}			          
		});
	});
</script>

<textarea id="tstText" name="tstText"></textarea>

</br></br></br></br>
<script>
	function test(){
		alert("TEST");
		
		var newDate = Date.parseExact("12-10-2004","d-MMM-yyyy");
		console.log(newDate);
	}
	
	function popupResult(obj){
		//alert("Get Popup Result! " + obj);
		
		//$("#txtid2").val(obj);
		console.log(obj);
		$("#txtid2").val(obj.name);
		
	}
	
</script>

</br></br></br></br>
Widget Sample </br>
============================================</br>
<script>
	//var filterObjTest = "Ini testing filter";
	function testBeforePopup(){
		alert("before popup !");
	}
</script>

<?php 
	echo " Calender  :"; $this->widget('application.components.widgets.DateTextField', array('name'=>'txtid','value'=>'20-Jan-2014'));
	
	
	echo "</br>";
	
	echo " Master ID  :";
	$this->widget('application.components.widgets.FindTextField', 
		array('options' => array('id'=>'txtid2','value'=>'',),
			'windowParams' => array('url'=>"index.php?r=sample/popupWindow",
				'specs'=> array('height'=>500),
			),
			'callback'=>"popupResult",
			'beforePopupFunc'=>"testBeforePopup",
		)
	);
	
	echo "* Execute callback after select item </br>";
	
	echo "</br>";
	
	echo "Action Bar  :";
	echo "<div style='width:500px'>";
	$this->widget('application.components.widgets.ActionBar', 
		array("menuAlign" => "right", 
			'items' => array(
				array(
					'id' => "itemId1",
					'title' => "New",
					'icon' => "images/action/Actions-document-new-icon.png",
					'callback'=>"test"
				),				
				array(
					'id' => "itemId2",
					'title' => "Delete",
					'icon' => "images/action/Actions-edit-clear-icon.png",
					'callback'=>"test"
				),
				
			)
		)
	);
	echo "</div>";	
?>
<input type="button" value="test button" />


</br></br></br></br>
hintbox Sample </br>
============================================</br>
<div>
	<a href="#" class="hintanchor" onMouseover="showhint('Please choose a username. Should consist of alphanumeric characters only.', this, event, '150px')">[?]</a><br />
	<a class="hintanchor" onMouseover="showhint('Please choose a username',this)"> <?php echo Yii::t("test","Ini Line berikutnya"); ?> </a>
</div>

</br></br></br></br>
translator Sample </br>
============================================</br>
<div>
	<!-- default setting langguange di main.php adalah id -->
	<?php Yii::app()->language = "id" ; ?>
	<?php echo "Ini Line Berikutnya => ". Yii::t("test","Ini Line berikutnya"); ?> </br>
	<?php Yii::app()->language = "en" ; ?>
	<?php echo "Ini Line Berikutnya => ". Yii::t("test","Ini Line berikutnya"); ?> </br>
	
	
</div>

</br></br></br></br>

Get Parameter Sample </br>
============================================</br>
<div style="font-weight:bold">
	<div>Get Post Parameter $_POST : Yii::app()->request->getPost('paramName','Default value if not set');</div>
	<div>Get Post Parameter $_GET : Yii::app()->request->getQuery('paramName','Default value if not set');</div>
	<div>Get Post Parameter $_REQUEST : Yii::app()->request->getParam('paramName','Default value if not set');</div>
</div>

</br></br></br></br>
Return JSON result </br>
============================================</br>
<pre>
	private $result = array("actionStatus"=>0,"actionMessage"=>"","model"=>array(),"actionError"=>array());
	header('Content-type:application/json');
	echo CJSON::encode($this->result);
</pre>

</br></br></br></br>